<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>

	<script type="text/javascript">
	
		function alternaDiv() {
			
			var div1 = document.getElementById("div1");
			var div2 = document.getElementById("div2");
			
			if (div1.style.display == "none") {
				div1.style.display = "block";
				div2.style.display = "none";
			} else {
				div1.style.display = "none";
				div2.style.display = "block";
			}
		}
	
	</script>


</head>
<body>

	<div id="div1">
		Div 1
	</div>

	<div id="div2" style="display: none">
		Div 2
	</div>
	
	<input type="button" onclick="alternaDiv();" value="Alterna" />
</body>
</html>